package com.battery.system.service.impl;

import com.battery.common.core.text.Convert;
import com.battery.common.utils.DateUtils;
import com.battery.system.domain.WsPointsConvert;
import com.battery.system.mapper.WsPointsConvertMapper;
import com.battery.system.service.IWsPointsConvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 积分兑换订单Service业务层处理
 * 
 * @author battery
 * @date 2021-02-22
 */
@Service
public class WsPointsConvertServiceImpl implements IWsPointsConvertService 
{
    @Autowired
    private WsPointsConvertMapper wsPointsConvertMapper;

    /**
     * 查询积分兑换订单
     * 
     * @param id 积分兑换订单ID
     * @return 积分兑换订单
     */
    @Override
    public WsPointsConvert selectWsPointsConvertById(String id)
    {
        return wsPointsConvertMapper.selectWsPointsConvertById(id);
    }

    /**
     * 查询积分兑换订单列表
     * 
     * @param wsPointsConvert 积分兑换订单
     * @return 积分兑换订单
     */
    @Override
    public List<WsPointsConvert> selectWsPointsConvertList(WsPointsConvert wsPointsConvert)
    {
        return wsPointsConvertMapper.selectWsPointsConvertList(wsPointsConvert);
    }

    /**
     * 新增积分兑换订单
     * 
     * @param wsPointsConvert 积分兑换订单
     * @return 结果
     */
    @Override
    public int insertWsPointsConvert(WsPointsConvert wsPointsConvert)
    {
        wsPointsConvert.setCreateTime(DateUtils.getNowDate());
        return wsPointsConvertMapper.insertWsPointsConvert(wsPointsConvert);
    }

    /**
     * 修改积分兑换订单
     * 
     * @param wsPointsConvert 积分兑换订单
     * @return 结果
     */
    @Override
    public int updateWsPointsConvert(WsPointsConvert wsPointsConvert)
    {
        wsPointsConvert.setUpdateTime(DateUtils.getNowDate());
        return wsPointsConvertMapper.updateWsPointsConvert(wsPointsConvert);
    }

    /**
     * 删除积分兑换订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWsPointsConvertByIds(String ids)
    {
        return wsPointsConvertMapper.deleteWsPointsConvertByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除积分兑换订单信息
     * 
     * @param id 积分兑换订单ID
     * @return 结果
     */
    @Override
    public int deleteWsPointsConvertById(String id)
    {
        return wsPointsConvertMapper.deleteWsPointsConvertById(id);
    }

    @Override
    public List<WsPointsConvert> selectWsPointsConvertListByMap(Map<String, Object> map) {
        return wsPointsConvertMapper.selectWsPointsConvertListByMap(map);
    }

    @Override
    public WsPointsConvert selectPointsConvertByTrandeNo(String tradeNo) {
        return wsPointsConvertMapper.selectPointsConvertByTrandeNo(tradeNo);
    }
}
